package com.quanyan.runningriding.web.running;

import com.quanyan.api.APIResponse;
import com.quanyan.common.Plugin.PageObj;
import com.quanyan.runningriding.entity.vo.run.resp.MusicOperationType;
import com.quanyan.runningriding.service.RunMusicOperationTypeService;
import org.apache.commons.collections.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;


/**
 * Created by liubin on 2016/12/15.
 * 显示 精选 喜欢 缓存歌单
 */

@RestController
@RequestMapping(value = "/api/run")
public class RunMusicOperationTypeController {
    @Autowired
    private RunMusicOperationTypeService runMusicOperationTypeService;
    private Logger logger = LoggerFactory.getLogger(RunMusicOperationTypeController.class);

    @RequestMapping(value = "/musicOperationTypeList", method = RequestMethod.POST)
    public APIResponse<List<MusicOperationType>> musicOperationTypeList(@RequestBody Map<String,Object> paramMap){
        String userId = MapUtils.getString(paramMap, "userId");
        if (userId == null || "".equals(userId)) {
            return APIResponse.returnFail("用户id不能为空");
        }
        APIResponse<List<MusicOperationType>> result = runMusicOperationTypeService.musicOperationTypeList(paramMap);
        return result;
    }

}
